var events = require("events");

var eventEmitter = new events.EventEmitter();

var connectHandler = function connected(){
    console.log("连接成功");

    eventEmitter.emit("data_recevied");
}

eventEmitter.on("data_recevied", function(){
    console.log("数据接收成功");
})

eventEmitter.on("connection", connectHandler);

eventEmitter.emit("connection");

console.log('over')